package util;

import dao.CountryDao;
import entity.Countries;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

public class Test {
    public static void main(String[] agrs) throws SQLException{
        Connection con=DBUtil.getCon();
        ResultSet rs=DBUtil.find("select * from employees");
        while (rs.next()){
            //System.out.println(rs.getString("first_name"));
        }
        System.out.println("-------------------");
        String sql="select * from employees where salary>? and department_id=?";
        ResultSet rs1=DBUtil.find(sql,1000,80);
        while (rs1.next()){
            //System.out.println(rs1.getString(2));
        }
        CountryDao cd=new CountryDao();
        List<Countries> cts=cd.findAll();
        for (Countries c:cts){
           // System.out.println(c);
        }
        List<Countries> cts1=cd.findByName("%a%");
        for (Countries c:cts1){
            System.out.println(c);
        }

    }
}
